<template>
	<view class="content">
		<view class="topSearch">
			<view class="topSearchs">
				<u-search placeholder="搜索" v-model="keyword" :show-action="false"></u-search>
			</view>
			<scrollx class="coright"></scrollx>
		</view>
		<view class="classState">
			<view class="classState_left">
				<scroll-view class="classState_left_scroll" :show-scrollbar="false" :scroll-y="true">
					<view :class="{'classState_left_son':true,'classState_left_son_red':isActive == item.id}"
						v-for="(item,index) in isArray" :key="index" @click="gotoDetail(item)">
						{{item.name}}

						<view class="topTinit">
							<view class="sizeFight">

							</view>
						</view>
						<view class="topBinit">
							<view class="sizeFight">

							</view>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="classState_right">
				<view class="classState_topState">
					<view class="classState_topState_l">
						动力提升
					</view>
					<view class="classState_topState_r">
						去保养<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
				<view class="classState_detail">
					<view class="classState_detail_son">
						<view class="classState_detail_son_img_fat">
							<image src="../../static/images/dd2.jpg" class="classState_detail_son_img" mode=""></image>
						</view>
						<view class="classState_detail_son_text">
							发动机养护111111111111
						</view>
					</view>
					<view class="classState_detail_son">
						<view class="classState_detail_son_img_fat">
							<image src="../../static/images/dd2.jpg" class="classState_detail_son_img" mode=""></image>
						</view>
						<view class="classState_detail_son_text">
							发动机养护111111111111
						</view>
					</view>
					<view class="classState_detail_son">
						<view class="classState_detail_son_img_fat">
							<image src="../../static/images/dd2.jpg" class="classState_detail_son_img" mode=""></image>
						</view>
						<view class="classState_detail_son_text">
							发动机养护111111111111
						</view>
					</view>
					<view class="classState_detail_son">
						<view class="classState_detail_son_img_fat">
							<image src="../../static/images/dd2.jpg" class="classState_detail_son_img" mode=""></image>
						</view>
						<view class="classState_detail_son_text">
							发动机养护111111111111
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import scrollx from "../../component/scrollx.vue"
	export default {
		data() {
			return {
				keyword: '',
				isActive: 0,
				isArray: [{
					name: '动力提升',
					id: 0
				}, {
					name: '推荐养护',
					id: 1
				}, {
					name: '高频必换',
					id: 2
				}, {
					name: '高里程必看',
					id: 3
				}, {
					name: '照明升级',
					id: 4
				}, {
					name: '创意新品定制',
					id: 5
				}, {
					name: '冷却系统养护',
					id: 6
				}, {
					name: '冷却系统养护',
					id: 7
				}, {
					name: '冷却系统养护',
					id: 8
				}, {
					name: '冷却系统养护',
					id: 9
				}, {
					name: '冷却系统养护',
					id: 10
				}, {
					name: '冷却系统养护',
					id: 11
				}, {
					name: '冷却系统养护',
					id: 12
				}, {
					name: '冷却系统养护',
					id: 13
				}, {
					name: '冷却系统养护',
					id: 14
				}, {
					name: '冷却系统养护',
					id: 15
				}, {
					name: '冷却系统养护',
					id: 16
				}, {
					name: '冷却系统养护',
					id: 17
				}, {
					name: '冷却系统养护',
					id: 18
				}, {
					name: '冷却系统养护',
					id: 19
				}, {
					name: '冷却系统养护',
					id: 20
				}, {
					name: '冷却系统养护',
					id: 21
				}, {
					name: '冷却系统养护',
					id: 22
				}, {
					name: '冷却系统养护',
					id: 23
				}, {
					name: '冷却系统养护',
					id: 24
				}, {
					name: '冷却系统养护',
					id: 25
				}, ]
			}
		},
		components: {
			scrollx
		},
		onLoad() {},
		methods: {
			gotoDetail(e) {
				this.isActive = e.id
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: #f6f6f6;

		.topSearch {
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			z-index: 999;
			padding: 70rpx 30rpx 15rpx;
			// height: 300rpx;
			width: 100%;
			background-color: #FFFFFF;
			box-sizing: border-box;
			margin-bottom: 15rpx;

			.topSearchs {
				margin-bottom: 20rpx !important;
			}

		}

		.classState {
			display: flex;
			width: 100%;
			margin-top: 315rpx;
			height: calc(100vh - 315rpx);

			.classState_left {
				overflow: hidden;
				white-space: wrap;
				background-color: #f6f6f6;
				height: 100%;
				flex: 1;

				.classState_left_scroll {
					width: 100%;
					height: 100%;

					.classState_left_son {
						display: inline-block;
						width: 100%;
						height: 100rpx;
						line-height: 100rpx;
						text-align: center;
						font-size: 24rpx;
					}

					.classState_left_son_red {
						position: relative;
						color: #ff0000;
						font-size: 24rpx;
						background-color: #ffffff;
						// border-top-right-radius: 30rpx;
						// border-bottom-right-radius: 30rpx;
						font-weight: 700;

						.topTinit {
							background-color: #ffffff;
							position: absolute;
							right: 0;
							top: -30rpx;
							width: 30rpx;
							height: 30rpx;

							.sizeFight {
								width: 30rpx;
								height: 30rpx;
								background-color: #f6f6f6;
								border-bottom-right-radius: 30rpx;
							}
						}

						.topBinit {
							position: absolute;
							background-color: #ffffff;
							right: 0;
							bottom: -30rpx;
							width: 30rpx;
							height: 30rpx;

							.sizeFight {
								width: 30rpx;
								height: 30rpx;
								background-color: #f6f6f6;
								border-top-right-radius: 30rpx;
							}
						}
					}

					.classState_left_son_red::before {
						content: '';
						position: absolute;
						top: 50%;
						left: 5rpx;
						transform: translateY(-50%);
						width: 8rpx;
						height: 40rpx;
						display: inline-block;
						background-image: linear-gradient(to bottom, #ff6000, #ff0000);
						border-radius: 4rpx;
					}
				}
			}

			.classState_right {
				overflow-y: scroll;
				padding: 0 15rpx;
				box-sizing: border-box;
				white-space: wrap;
				flex: 3;
				background-color: #FFFFFF;

				.classState_topState {
					width: 100%;
					height: 55rpx;
					padding: 0 15rpx;
					box-sizing: border-box;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.classState_topState_l {
						font-size: 24rpx;
						font-weight: 700;
						color: #000000;
					}

					.classState_topState_r {
						font-size: 22rpx;
						color: #626262
					}
				}

				.classState_detail {
					width: 100%;
					display: flex;
					flex-wrap: wrap;

					.classState_detail_son {
						height: 220rpx;
						width: 33%;
						padding: 10rpx 15rpx;
						background-color: #FFFFFF;

						.classState_detail_son_img_fat {
							background-color: #f8f8f8;
							width: 100%;
							height: 155rpx;
							border-radius: 10rpx;
							overflow: hidden;
							margin-bottom: 15rpx;

							.classState_detail_son_img {
								width: 100%;
								height: 155rpx;
							}
						}

						.classState_detail_son_text {
							width: 100%;
							height: 30rpx;
							font-size: 24rpx;
							text-align: center;
							color: #3c3c3c;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}
					}
				}
			}
		}
	}
</style>
